#include "Avatar.h"
#include <SFML\Graphics.hpp>

Avatar::Avatar(int height, int width, Color color, Vector2f velocity, float pos_x, float pos_y) : _velocity(velocity)
{
	myForm =RectangleShape(Vector2f(height,width));
	myForm.setFillColor(color);
	myForm.setPosition(pos_x,pos_y);
}

Avatar::~Avatar() {}

RectangleShape& Avatar::getForm()
{
	return myForm;
}

void Avatar::move(float delta)
{
	myForm.move(_velocity.x*delta, _velocity.y*delta);
}

void Avatar::setVelocity(Vector2f velocity)
{
	_velocity=velocity;
}

void Avatar::addVelocity(Vector2f velocity)
{
	_velocity.x +=velocity.x;
	_velocity.y +=velocity.y;
}
void Avatar::draw(RenderWindow& window)
{
	window.draw(myForm);
}